/*
 * Copyright (C) 2009 Georgios J. Georgopoulos, All rights reserved.
 * 
 * This is free software; you can redistribute it and/or modify it under the
 * terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 3 of the License, or (at your option) any
 * later version.
 * 
 * This software is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this software; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
 * site: http://www.fsf.org.
 */
package org.gwt.mosaic.xul.client.ui;

import org.gwt.mosaic.core.client.CoreConstants;
import org.gwt.mosaic.ui.client.layout.HasLayoutManager;
import org.gwt.mosaic.ui.client.util.WidgetHelper;

import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.DeferredCommand;
import com.google.gwt.user.client.Timer;
import com.google.gwt.user.client.ui.Widget;

/**
 * A single cell of a listbox. By default it only contains text but icons and
 * checkbox listcells are also available.
 * 
 * @author georgopoulos.georgios(at)gmail.com
 * 
 */
public class Listcell extends Element {
  private static final long serialVersionUID = -3026785458823385469L;

  /**
   * The label that will appear on the element. If this is left out, no text
   * appears.
   */
  public static final String LABEL = "label";

  public Listcell() {
    super();
  }

  @Override
  protected Widget createUI() {
    return null;
  }

  public String getLabel() {
    return getString(LABEL);
  }

  public void setLabel(String label) {
    putString(LABEL, label);
  }

  // protected void updateUI(String property, Object oldValue, Object newValue)
  // {
  // Container parent = getParent();
  // if (parent instanceof Listitem) {
  // Listitem listitem = (Listitem) parent;
  // int index = listitem.indexOf(parent);
  // listitem.getAttributeMap().put("listitem"+index, listitem);
  // }
  // super.updateUI(property, oldValue, newValue);
  // }

}
